﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Management;
using System.Text;
using Gma.QrCodeNet.Encoding;

namespace ConsoleTest
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.Write(@"Type some text to QR code: ");
            var sampleText = Console.ReadLine();
            var qrEncoder = new QrEncoder(ErrorCorrectionLevel.M);
            var qrCode = qrEncoder.Encode(sampleText);
            for (var j = 0; j < qrCode.Matrix.Width; j++)
            {
                for (int i = 0; i < qrCode.Matrix.Width; i++)
                {

                    char charToPrint = qrCode.Matrix[i, j] ? '█' : ' ';
                    Console.Write(charToPrint);
                }
                Console.WriteLine();
            }
            Console.WriteLine(@"Press any key to quit.");
            Console.ReadKey();
        }
    }
}
